package com.xinqi.modules.sys.textbook.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.sys.textbook.dto.req.CloudTextbookCatalogQueryDTO;
import com.xinqi.modules.sys.textbook.dto.rsp.CloudTextbookCatalogResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author linkai
 * @date 2023/5/28
 */
@FeignClient(contextId = "cloudTextbookCatalogClient", value = ServiceNameConstants.XQ_SYS)
public interface CloudTextbookCatalogClient {

    @GetMapping("/inner/cloud-textbook/catalog/page")
    R<PageInfo<CloudTextbookCatalogResultDTO>> page(@SpringQueryMap CloudTextbookCatalogQueryDTO log);

    @GetMapping("/inner/cloud-textbook/catalog/{id}")
    R<CloudTextbookCatalogResultDTO> findById(@PathVariable("id") Long id);

    @GetMapping("/inner/cloud-textbook/tree")
    R<List<CloudTextbookCatalogResultDTO>> tree(@RequestParam("textbookId") Long textbookId);

    @GetMapping("/inner/cloud-textbook/find-catalog-by-cloud-textbook-id")
    R<List<CloudTextbookCatalogResultDTO>> findByCloudTextbookId(@RequestParam("textbookId") Long textbookId);

}
